import request from '/@/utils/request';


/**
 * 根据类型查询字典数据列表
 * @param type
 */
export function queryByType(type: string) {
    return request({
        url: '/sysDictData/type/'+type,
        method: 'get'
    });
}

/**
 * 添加字典数据
 * @param params
 */
export function addDictData(params: Object) {
    return request({
        url: '/sysDictData',
        method: 'post',
        data: params,
    });
}


export function updateDict(params: Object) {
    return request({
        url: '/sysDictData',
        method: 'put',
        data: params,
    });
}

export  function deleteById(dictCode:string | number){
    return request({
        url: '/sysDictData/'+dictCode,
        method: 'delete'
    });
}
